<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>测试生成随机数</title>
</head>
<body>
    <div id="app">
        {{msg}}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script type="text/javascript">
        function random(){
            return Math.floor(Math.random()*10+1);
        }

        var app = new Vue({
            el:"#app",
            data:{
                msg:random()
            }
        });

    </script>
</body>
</html>